package main

import (
	"encoding/json"
	"log"
	"os"
)

type Cook struct {
	Name        string //名称
	//id          int
	//food        string //食物
	//img         string //图片
	//images      string //图片,
	//description string //描述
	//keywords    string //关键字
	//message     string //资讯内容
	//count       int    //访问次数
	//fcount      int    //收藏数
	//rcount      int    //评论读数
	//url         string
}

func main() {
	r, err := os.Open("K:/IdeaProjects/gitosc/caipus/json/cook.json")
	if err != nil {
		log.Fatalln(err)
	}
	decoder := json.NewDecoder(r)
	var c Cook
	err = decoder.Decode(&c)
	if err != nil {
		log.Fatalln(err)
	}

	log.Println(c.Name)

	//for k, v := range c.Broker {
	//	log.Println(k, v.Host, v.Port)
	//}
	//for k, v := range c.Backend {
	//	log.Println(k, v.Host, v.Port)
	//}
}
